from Base.Base import Base
from selenium.webdriver.common.by import By
from time import sleep

class Page_two(Base):
    # 点击登录
    to_login = (By.CLASS_NAME,'headerLogin')
    # 用户名输入框
    un=(By.ID,'userName')
    # 密码输入框
    pw=(By.ID,'password')

    # 点击登录
    login=(By.NAME,'bi_Usuallogin')
    # 点击确定
    sure=(By.CLASS_NAME,'bindSub')
    # 点击我的酒仙
    myjiu=(By.XPATH,'/html/body/div[2]/div/div[2]/ul/li[1]/div[1]/a')

    notice=(By.XPATH,'//*[@id="uGuideBox"]/div/div/span')


    message=(By.XPATH,'/html/body/div[4]/div[1]/div[2]/div[4]/a[2]/span')

    anothername=(By.XPATH,'//*[@id="anotherName"]')
    # 断言个人信息
    peomessage=(By.XPATH,'/html/body/div[4]/div[3]/div[2]/div/div[1]/ul/li[1]')


    submit=(By.CLASS_NAME,'submitZpInfo')


    def go_login(self):
        self.click(self.to_login)

    def send_un(self):
        self.send_leys(self.un, '15523670956')

    def send_pw(self):
        self.send_leys(self.pw, 'Wzs123456')

    def click_login(self):
        self.click(self.login)
    def click_sure(self):
        self.click(self.sure)
    def click_my(self):
        self.click(self.myjiu)
    def close_notice(self):
        self.click(self.notice)
    def click_mm(self):
        self.click(self.message)

    def dy(self):
        text=self.get_text(self.peomessage)
        return text

    def send_an(self):
        self.send_leys(self.anothername,'懂得且振都')
    def click_submit(self):
        self.click(self.submit)

    def test_two(self):
        self.go_login()
        self.send_un()
        self.send_pw()
        sleep(10)
        self.click_login()
        self.click_sure()
        self.click_my()
        self.new_window()
        self.window_scroll(800)
        self.click_mm()
        text=self.dy()
        self.send_an()
        self.click_submit()
        return text






